<html>
<head>
<!-- <link rel="stylesheet" type="text/css" href="style/admin.css"> -->
</head>
<body>
<div>
	<a href="../">Go to site</a>
</div>
<?php include("menu.php")?>

<table>
<tr><th>Title</th><th></th></tr>
<?php
$con = mysqli_connect ( "localhost", "cms", "cms", "cms" );
if (mysqli_connect_errno ()) { // Check connection
	echo "Failed to connect to MySQL: " . mysqli_connect_error ();
}
$result = mysqli_query ( $con, "SELECT id,title,content FROM page" );

while ($row = mysqli_fetch_array ( $result )) {
	?>
		<tr>
		  <td><?php echo $row[title]; ?></td>
		  <td><a href="<?php echo 'edit_page.php?id='.$row[id]; ?>">Edit</a></td>
		</tr>
	<?php 	
}
?>

</table>
</body>
</html>